package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.UserInfoBean;
import com.lianzhihui.romeex.bean.UserRegisterKFBean;
import com.lianzhihui.romeex.mvp.model.InvitationModelImp;
import com.lianzhihui.romeex.mvp.model.InvitationModelInterface;
import com.lianzhihui.romeex.mvp.model.MeFragmentModelImp;
import com.lianzhihui.romeex.mvp.model.MeFragmentModelInterface;
import com.lianzhihui.romeex.mvp.view.InvitationView;
import com.lianzhihui.romeex.mvp.view.MeFragmentView;

//逻辑实现
public class MeFragmentPresnterImp implements MeFragmentModelInterface {

    private final MeFragmentView viewLayer;
    private final MeFragmentModelImp modelImp;

    public MeFragmentPresnterImp(Context context, MeFragmentView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new MeFragmentModelImp(context, this);
    }

    public void requestHomeInfo() {
        modelImp.requestUserInfo();
    }

    public void requestUserRegisterKF() {
        modelImp.requestUserRegisterKF();
    }


    @Override
    public void responseSuccess(UserInfoBean b) {
        viewLayer.success(b);
    }

    @Override
    public void responseUserRegisterKFSuccess(UserRegisterKFBean b) {
        viewLayer.responseUserRegisterKFSuccess(b);
    }


    @Override
    public void onFailure() {
        viewLayer.setFailure();
    }
}
